<form action="<?php e_action("modifySubmit"); ?>" method="post"  enctype="multipart/form-data">
    <fieldset>
    </fieldset>
    <fieldset>
        <legend>基本信息</legend>
        <input type="hidden" name="goods_id" value="<?php echo $r['id'] ?>"/>
        <input type="hidden" name="gopen_id" value="<?php echo $r['gopen_id'] ?>"/>
        <input type="hidden" name="shop_id" value="<?php echo $r['shop_id'] ?>"/>
        <input type="hidden" name="price_id" value="<?php echo $r['price_id'] ?>"/>

        <label for="goodsName">商品名</label>
        <input type="text" name="goodsName" id="goodsName" value="<?=$r['name'];?>" placeholder="请输入商品名" required/><br/>
        <label for="goods_cat_id">所属分类</label>
        <select name="goods_cat_id" id="goods_cat_id">
            <?php foreach($r['goods_cat'] as $v){?>
                <option value="<?php echo $v['id'] ?>" <?php if($r['goods_cat_id']==$v['id']) echo 'selected' ?>><?php echo $v['name'] ?></option>
            <?php }?>
        </select><br/>
        <label for="unit">单位</label>
        <input type="text" name="unit" id="unit" value="<?php echo $r['unit']?>" placeholder="请输入单位" required><br/>
        <legend>标签选择</legend>
        <label for="label">标签</label>
        <?php foreach($r['label'] as $k=>$v){?>
            <label>
                <input type="checkbox" name="label[]" value="<?php echo $v['id'];?>"
                    <?php if(in_array($v['id'],explode(",",$r['label_ids']))) echo "checked"; ?>/>
                <?php echo $v['name']?></label>
        <?php }?><br/>
        <label for="qq">客服QQ</label>
        <input type="text" name="qq" id="qq" value="<?php echo $r['qq']?>" placeholder="请输入客服QQ" required><br/>
        <label for="tip_id">买家须知</label>
        <select name="tip_id" id="tip_id">
            <?php foreach($r['tip'] as $v){?>
                <option value="<?php echo $v['id'] ?>" <?php if($r['tip_id']==$v['id']) echo 'selected' ?>><?php echo $v['title'] ?></option>
            <?php }?>
        </select><br/><br/>
        <label for="note">购买注意</label>
        <input type="text" name="note" id="note" value="<?php echo $r['note']?>" placeholder="请输入购买注意" required><br/>
    </fieldset>

    <fieldset>
        <legend>价格信息</legend>
        <label for="original_price">原价</label>
        <input type="text" name="original_price" id="original_price" value="<?php echo $r['prices']['original_price']?>" placeholder="请输入原价" required><br/>
        <label for="base_price">基本价格</label>
        <input type="text" name="base_price" id="base_price" value="<?php echo $r['prices']['base_price']?>" placeholder="请输入基本价格" required><br/>
        <label for="low">少量商品数</label>
        <input type="text" name="low" id="low" value="<?php echo $r['prices']['low']?>" placeholder="请输入少量商品数"><br/>
        <label for="medium_price">中等价格</label>
        <input type="text" name="medium_price" id="medium_price" value="<?php echo $r['prices']['medium_price']?>" placeholder="请输入中等价格"><br/>
        <label for="medium">大量商品数</label>
        <input type="text" name="medium" id="medium" value="<?php echo $r['prices']['medium']?>" placeholder="请输入大量商品数"><br/>
        <label for="high_price">最低价格</label>
        <input type="text" name="high_price" id="high_price" value="<?php echo $r['prices']['high_price']?>" placeholder="请输入最低价格"><br/>
    </fieldset>
    <fieldset>
        <legend>分享提成信息</legend>
        <label for="bonus">分享提成</label>
        <input type="text" name="bonus" id="bonus" value="<?=$r['bonus'] ?>" placeholder="请输入分享提成"/><br/>
        <label for="commission">代购提成</label>
        <input type="text" name="commission" id="commission" value="<?=$r['commission'] ?>" placeholder="请输入代购提成"/><br/>
        <label for="service_fee">服务站费用</label>
        <input type="text" name="service_fee" id="service_fee" value="<?=$r['service_fee'] ?>" placeholder="请输入服务站费用"/><br/>
        <label for="platform_fee">平台费用</label>
        <input type="text" name="platform_fee" id="platform_fee" value="<?=$r['platform_fee'] ?>" placeholder="请输入平台费用"/><br/>
    </fieldset>
    <fieldset>
        <legend>产品详情</legend>
        <script id="aTextInput" name="detail" class="editor" type="text/plain"><?=$r['detail'];?></script>
    </fieldset>
    <fieldset>
        <legend>供应商详情</legend>
        <script id="supplier" name="supplier" class="editor" type="text/plain"><?=$r['supplier'];?></script>
    </fieldset>
    <input type="submit" value="保存"/>
</form>